CREATE OR REPLACE TYPE tab_varchar IS TABLE OF VARCHAR2(100);
/
CREATE OR REPLACE FUNCTION string_to_table(p VARCHAR2)
   RETURN tab_varchar
   PIPELINED IS
BEGIN
   FOR cc IN (SELECT rtrim(regexp_substr(str, '[^,]*,', 1, level), ',') res
                FROM (SELECT p || ',' str FROM dual)
              CONNECT BY level <= length(str) 
                                  - length(replace(str, ',', ''))) LOOP
      PIPE ROW(cc.res);
   END LOOP;
END;
/
